#ifndef CYBERGLOVE_H
#define CYBERGLOVE_H

#include <QTimer>

#include "quart.h"

class Cyberglove : public QUart
{
    Q_OBJECT
public:
    explicit Cyberglove(bool is3IMUFormat = false, QWidget *parent = 0);

    bool setSampleRate(int rate);
    void setIMUFormat(bool is3IMUFormat);

signals:
    void takeData(uchar channel, short data);

private:
    void dataProcessing(QByteArray ba);
    void pingChannel(unsigned char channel);

    char channelCount;

    QTimer *timer;
    int sampleRate;
    uchar currentAddres;
    uchar channelInd;
    //    bool receiveFlag;
    //    QByteArray buffer;


private slots:
    void onTimer();
    void onConnect();
    void onDisconnect() {timer->stop();}

};


#endif // CYBERGLOVE_H
